/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Press Start 2P', cursive, 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #222;
    color: #fff;
    overflow: hidden;
}

/* 游戏容器 */
.game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 屏幕样式 */
.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: opacity 0.5s ease;
}

/* 初始隐藏其他屏幕 */
#game-screen,
#pause-screen,
#game-over-screen,
#victory-screen,
#instructions-screen {
    display: none;
}

/* 标题样式 */
h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #4CAF50;
    text-shadow: 3px 3px 0 #000;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #4CAF50;
    text-shadow: 2px 2px 0 #000;
}

/* 按钮样式 */
button {
    background-color: #4CAF50;
    border: 3px solid #000;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 5px 5px 0 #000;
    transform: translateY(-2px);
}

button:hover {
    background-color: #45a049;
    transform: translateY(0);
    box-shadow: 3px 3px 0 #000;
}

button:active {
    transform: translateY(2px);
    box-shadow: 1px 1px 0 #000;
}

/* 游戏画布 */
#game-canvas {
    background-color: #696969;
    border: 5px solid #000;
    cursor: crosshair;
    max-width: 100%;
    max-height: 100%;
}

/* 游戏HUD */
.game-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border: 3px solid #000;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.5);
}

.health {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-bar {
    width: 150px;
    height: 25px;
    background-color: #333;
    border: 2px solid #000;
    position: relative;
    overflow: hidden;
}

#health-fill {
    height: 100%;
    width: 100%;
    background-color: #f44336;
    transition: width 0.3s ease;
}

.ammo,
.weapon,
.score,
.timer {
    padding: 5px 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid #000;
}

/* 暂停按钮 */
#pause-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 14px;
}

/* 游戏说明列表 */
ul {
    text-align: left;
    margin: 20px 0;
    max-width: 500px;
    line-height: 1.8;
}

li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 20px;
}

li:before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #4CAF50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    .game-hud {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 像素风格动画 */
@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.blink {
    animation: blink 1s infinite;
}

/* 加载字体 */
@font-face {
    font-family: 'Press Start 2P';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/pressstart2p/v14/e3t4euO8T-267oIAQAu6jDQyK3nVivM.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}